package com.xbongbong.saas.model;

import com.xbongbong.paas.field.RelyPoJo;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.pro.domain.entity.LinkProductRelyEntity;

import java.util.List;

/**
 * 数据联动
 * @author feng.zhenng
 * @version v1.0
 * @date 2020/3/18 15:08
 * @since v1.0
 */
public interface LinkProductRelyModel extends IModel<LinkProductRelyEntity> {

    List<LinkProductRelyEntity> getByFormId(String corpid, Long formId, Integer del);

    /**
     * 新建时关联产品联动默认设置
     * @param corpid 公司
     * @param formId 表单id
     * @return 关联关系
     */
    List<RelyPoJo> selectProductRely(String corpid, Long formId);

    List<LinkProductRelyEntity> getByFormIdAndLinkFormId(String corpid, Long formId, Long linkFormId, Integer del);

    LinkProductRelyEntity getByAttrAndFormIdAndLinkFormId(String corpid, String attr, Long formId, Long linkFormId, Integer del);

    LinkProductRelyEntity getByAttrAndFormIdAndSourceBusinessType(String corpid, String attr, Long formId, Integer sourceBusinessType, Integer del);

    Integer insertBatch(List<LinkProductRelyEntity> linkProductRelyEntityList);

    Integer updateBatch(List<LinkProductRelyEntity> linkProductRelyEntityList);
}
